#ifndef TOPTITLE_H
#define TOPTITLE_H

#include <QWidget>
#include <QEvent>
#include <QDebug>
#include <QDateTime>
#include "globalconfig.h"

namespace Ui {
class TopTitle;
}

class TopTitle : public QWidget
{
    Q_OBJECT

public:
    explicit TopTitle(QWidget *parent = nullptr);
    ~TopTitle();
    void setTitleName(QString strName);
    void setDriveMode(int mode);
    void setTrainSpeed(uint16_t speed);
    void setTrainStat(uint8_t stat);
    void setSpeedLimt(uint8_t speed);
    void setEffDmd(uint16_t value);
    void setDateTime();
    void setHighVoltage(uint16_t value);
    void updateHighestLevelStat(int level);
    void setCurStation(int id);
    void setEndStation(int id);
    void setNextStation(int id);
    void setMaintMode(bool xMaint);
    //atc
    void setDestinationID(uint32_t id);
    void updateDestinationID(uint8_t mode,uint32_t id);
    void setTripID(uint16_t tid);
    void setServiceID(uint16_t sid);
    void updateTripID(uint8_t mode, uint16_t tid, uint16_t sid);
    void setATCSystemMode(uint8_t mode);
signals:
    void showOperationHelp(int);
protected:
    bool eventFilter(QObject *obj, QEvent *event);
private:
    Ui::TopTitle *ui;
    uint32_t m_nDestinationID=0;
    uint16_t m_nTripID=0;
    uint16_t m_nServiceID=0;
    uint8_t  m_nATCSysMode=0;
};

#endif // TOPTITLE_H
